// Copyright 2012 Sergio, Raul, Dorival. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// STL
#include <iostream>
#include <cmath>

// GemLab
#include "gemlab.h"

using std::cout;
using std::endl;
using GemLab::Array;
using GemLab::String;

int main(int argc, char **argv) try
{
    GemLab::UMesh mesh(2); // 2D
    Array<double> X(5), Y(5);
    X = 0.0, 1.0, 1.0, 0.0, 0.5;
    Y = 0.0, 0.0, 1.0, 1.0, 0.5;
    mesh.Delaunay    (X, Y, /*Tag*/-1);
    mesh.TagSegsLine (-33, /*x0*/0.0, /*y0*/0.0, /*AlpDeg*/ 45.0);
    mesh.TagSegsLine (-44, /*x0*/0.0, /*y0*/1.0, /*AlpDeg*/-45.0);
    mesh.TagHorzSegs (-55, /*y*/1.0, /*xMin*/0.0, /*xMax*/1.0);
    mesh.GroundTags  (/*L*/-10, /*R*/-20, /*B*/-30);
    mesh.WriteMPY    ("delaunay01");
    cout << " File <delaunay01.mpy> generated\n";
    return 0;
}
GEMLAB_CATCH
